<?php
require("../config.php");

if ($class_go->C_title($_REQUEST['set']) == 2 )
{

	$user = $class_go->C_title($_REQUEST['user']);
	$wname = $class_go->C_title($_REQUEST['wname']);
	$wnum = $class_go->C_vlable($_REQUEST['wnum']);
	$wprice = $class_go->C_title($_REQUEST['wprice']);
	$sid = $class_go->C_title($_REQUEST['sid']);
	$uid = $class_go->C_title($_REQUEST['uid']);
	$time = time();
	$uname = $udb->sqls("select user_id from user_table where user_name='$user'");
	$userid = $uname[0]['user_id'];
	if($wnum>=$wnum1 && $wprice>$wprice1)
	{
		$udb->sqls("update sale_table set fprice=$wprice,showtime=$time,suid=$userid,sign=1 where sale_id=$sid");	
		echo "<script language=\"JavaScript\">alert(\"操作已成功!!\");</script>"; 
	}else
	{
		echo "<script language=\"JavaScript\">alert(\"请输入正确的数值!!\");</script>";
		echo "\n<!--Start header -->\n";
		require("../html/head.html");
		echo "\n<!--End header -->\n";
		echo "\n<!--Start Content -->\n";
		require("../html/polling_list.html");
		echo "\n<!--End Content -->\n";
		echo "\n<!--Start Foot -->\n";
		require("../html/foot.html");
		echo "\n<!--End Foot -->\n";
	}
	echo "<html><head></head ><body onLoad='javascript:window.opener=window.name;window.close();'></body></html>";
}
else
{
	/*echo "\n<!--Start header -->\n";
	require("../html/head.html");
	echo "\n<!--End header -->\n";
	echo "\n<!--Start Content -->\n";*/
	require("../html/polling_list.html");
	/*echo "\n<!--End Content -->\n";
	echo "\n<!--Start Foot -->\n";
	require("../html/foot.html");
	echo "\n<!--End Foot -->\n";*/
}
?>